Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed DBToken. Made the components uses Managed Identity #3584

Merged
merged 13 commits into from
Jun 12, 2024

Conversation

anshulvermapatel
Copy link
Collaborator

@anshulvermapatel anshulvermapatel commented May 16, 2024

Which issue this PR addresses:

As part of the ARO-5512 , we needed to disable local auth for cosmosdb. In order to disable local authentication, this PR is to make our components rely on managed identities/entra id rather than keys for authentication/authorizing cosmosdb.

This is currently a draft PR as I will be testing it in the INT env first before going forward, however, reviews are appreciated.

I have manually changed some generated code here. That was because the PR I created to have the generated code changed is not merged yet. Once that is merged, I will generate the code from the go-cosmosdb repo itself just like how we usually do.

Fixes
ARO-7195
ARO-7314

Test plan for issue:

There are multiple ways this can be tested.

  1. Checkout to this PR and try running Local RP and create a cluster using it.
  2. If you have a full dev RP service running. Try deploying this code and try creating a cluster post that.
  3. Try deploying this PR in INT env.

Copy link

Please rebase pull request.

@github-actions github-actions bot removed the needs-rebase branch needs a rebase label May 17, 2024
Copy link
Collaborator

@bennerv bennerv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also need to remove:

  • rm docs/dbtoken-service.md
  • The load balancing rule to allow gateway to talk to the dbtoken service from pkg/deploy (should be in templates)

We probably don't need to peer the gateway and RP vnets anymore. We might be able to remove that peering as well. Which would be good for overall security posture.

pkg/database/billing.go Outdated Show resolved Hide resolved
pkg/database/billing.go Outdated Show resolved Hide resolved
pkg/database/database.go Outdated Show resolved Hide resolved
pkg/database/openshiftclusters.go Outdated Show resolved Hide resolved
pkg/database/subscriptions.go Outdated Show resolved Hide resolved
pkg/deploy/devconfig.go Outdated Show resolved Hide resolved
pkg/database/database.go Show resolved Hide resolved
@anshulvermapatel
Copy link
Collaborator Author

/azp run ci,e2e

Copy link

Pull request contains merge conflicts.

@github-actions github-actions bot added the needs-rebase branch needs a rebase label May 22, 2024
Copy link

Please rebase pull request.

@github-actions github-actions bot removed the needs-rebase branch needs a rebase label May 22, 2024
@anshulvermapatel anshulvermapatel added the firefly Issues or Pull requests owned by Team Firefly label May 27, 2024
@SudoBrendan SudoBrendan added the next-release To be included in the next RP release rollout label Jun 7, 2024
Copy link
Collaborator

@SudoBrendan SudoBrendan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I have many concerns - can you drop me a quick comment on if removing the rp-backend rules from the internal LB is expected to have an impact, and/or why it's OK to delete?

Dockerfile.aro-multistage Show resolved Hide resolved
logrusEntry := log.WithField("component", "database")
dbAuthorizer, err := database.NewMasterKeyAuthorizer(ctx, logrusEntry, msiToken, clientOptions, _env.SubscriptionID(), _env.ResourceGroup(), dbAccountName)
scope := []string{fmt.Sprintf("https://%s.%s", dbAccountName, _env.Environment().CosmosDBDNSSuffixScope)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I've seen this same code 3 times in this PR so far, would it be worth extracting into something well named?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this was the way it was previously, I think lets address this in a separate PR

pkg/deploy/deploy.go Outdated Show resolved Hide resolved
Comment on lines -366 to -368
BackendAddressPool: &mgmtnetwork.SubResource{
ID: to.StringPtr("[resourceId('Microsoft.Network/loadBalancers/backendAddressPools', 'rp-lb-internal', 'rp-backend')]"),
},
Copy link
Collaborator

@SudoBrendan SudoBrendan Jun 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only removal that concerns me here and generally with the LB, it could just be an odd naming choice, but to be sure, this isn't removing the LB config for anything related to the RP Backend service in an impactful way, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rp-lb-internal is currently being used for gateway to request dbtoken service in RP, apart from that in my knowledge it is not used for anything else. Now since dbtoken service is being removed, there is no use of this LB

@anshulvermapatel
Copy link
Collaborator Author

/azp run ci,e2e

Copy link

Azure Pipelines successfully started running 2 pipeline(s).

@hlipsig
Copy link
Contributor

hlipsig commented Jun 11, 2024

Pretty sure e2e failed on the cert re-running.

/azp run e2e

@hlipsig
Copy link
Contributor

hlipsig commented Jun 11, 2024

/azp run e2e

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@hlipsig hlipsig dismissed jaitaiwan’s stale review June 12, 2024 15:33

Outdated and changes have been made since,

@hlipsig
Copy link
Contributor

hlipsig commented Jun 12, 2024

  • rm docs/dbtoken-service.md
  • The load balancing rule to allow gateway to talk to the dbtoken service from pkg/deploy (should be in templates)

Ben I'm going to make a follow on JIra and PRs for these because you're right but I don't think they should block the main body of work.

@hlipsig hlipsig dismissed bennerv’s stale review June 12, 2024 16:27

Creating follow on for remaining actions.

@hlipsig hlipsig merged commit 7775d14 into master Jun 12, 2024
20 checks passed
@mociarain mociarain deleted the anshulvermapatel/ARO-7195 branch June 25, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firefly Issues or Pull requests owned by Team Firefly next-release To be included in the next RP release rollout
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants